﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Htse.Blue.Controllers
{
	public static class SiteConstants
	{
		public const int PAGE_SIZE = 5;

		public const string ADMIN_ACCOUNT = "Administrator";

		public const string USER_ACCOUNT = "User";

		public static int GetPreferredPageSizeOrDefault(HttpSessionStateBase session)
		{
			int preferredPageSize;

			int.TryParse(
				session["PreferredPageSize"] != null ?
					session["PreferredPageSize"].ToString() :
					SiteConstants.PAGE_SIZE.ToString(),
				out preferredPageSize);

			return preferredPageSize;
		}

		public static void SetPreferredPageSize(HttpSessionStateBase session, int pageSize)
		{
			session["PreferredPageSize"] = pageSize;
		}
	}
}
